﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IBupro.Models.Classes;
using System.Web.Mvc;
using iBuproModel.Repositories.Interfaces;

namespace IBupro.Models
{
    public class DiplomProjectSearchModel : CustomModel
    {
        public int ProjectTypeId { get; set; }
        public int DepartmentId { get; set; }
        public string SearchString { get; set; }
        public IEnumerable<iBuproModel.DiplomProject> ProjectList { get; set; }
        public bool FreeOnly { get; set; }

        public SelectList GetDepartmentList()
        {
            IDepartmentRepository departments = repositoryService.DepartmentRepositoryCreateInstance();
            return new SelectList(departments.GetAll(d=> d.Visible == true), "Id", "Name");
        }

        public SelectList GetDiplomProjectTypeList()
        {
            IDiplomProjectTypeRepository types = repositoryService.DiplomProjectTypeRepositoryCreateInstance();
            return new SelectList(types.GetAll(), "Id", "Name");
        }

    }
}